﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.Entity;

namespace Irandeb4.Models
{
    public class InitialData : DropCreateDatabaseIfModelChanges<IrandebEntities>
    {
        protected override void Seed(IrandebEntities context)
        {
            new List<City>
            {
                new City {Name="La Paz"},
                new City {Name="Cochabamba"},
                new City {Name="Santa Cruz"},
                new City {Name="Potosi"},
                new City {Name="Oruro"},
                new City {Name="Sucre"},
                new City {Name="Tarija"},
                new City {Name="Beni"},
                new City {Name="Pando"}
            }.ForEach(a => context.cities.Add(a));
        
            new List<UserRole>
            {
                new UserRole {Role="Administrator"},
                new UserRole{Role="Employee"}
            }.ForEach(a => context.UsersRoles.Add(a));
        }
        
    }
}